import unittest

from selenium.webdriver.common.by import By

from Base.Base import Base

#结账管理
class settlement(Base):
    #点击结算管理
    loc_jiesuan=(By.XPATH,'/html/body/div[1]/div[2]/div[2]/div[2]/div[11]/h2/span')
    # 点击结算记录管理
    loc_jilu = (By.XPATH, '/html/body/div[1]/div[2]/div[2]/div[2]/div[12]/ul/li/div/a')
    #审核
    # loc_shen = (By.LINK_TEXT, '审核')
    #输入备注
    loc_bei = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input')
    #点击取消
    loc_ti = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[2]/div/div/button')
    #失败
    loc_shibai = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[1]/dd/input[2]')
    #输入备注
    # loc_bei = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input')
    #点击提交
    # loc_ti = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button')
    #打款
    # loc_shen = (By.LINK_TEXT, '打款')
    #否
    loc_fou = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[1]/dd/input[2]')
    #页面
    loc_ye = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[3]/div[2]/ul/li[15]/input[1]')
    #三角
    loc_sanjiao = (By.CLASS_NAME, 'goto')
    #审核
    loc_shen = (By.XPATH,'//*[@id="navTab"]/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[10]/div/a[2]')
    #备注
    # loc_bei = (By.XPATH, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input')
    #查看
    loc_chaka=(By.XPATH,'//*[@id="navTab"]/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[10]/div/a[1]')
    #打款
    loc_dakuan=(By.XPATH,'//*[@id="navTab"]/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[14]/td[10]/div/a[2]')
    #点击发起结算
    loc_faqi=(By.XPATH,'//*[@id="navTab"]/div[2]/div[2]/div[2]/div[1]/ul/li[1]/a/span')
    #输入用户编号
    loc_bianhao=(By.XPATH,'//*[@id="userNo"]')
    #用户名
    loc_hym=(By.XPATH,'//*[@id="navTab"]/div[2]/div[4]/div/form/div[1]/div/fieldset/dl[2]/dd/input')
    #可结算余额
    loc_ye=(By.XPATH,'//*[@id="settAmount"]')
    #结算金额
    loc_je=(By.XPATH,'//*[@id="navTab"]/div[2]/div[4]/div/form/div[1]/div/fieldset/dl[4]/dd/input')
    #结算保存
    loc_bc=(By.XPATH,'//*[@id="navTab"]/div[2]/div[4]/div/form/div[2]/ul/li[1]/div/div/button')
    #到三角
    loc_dao=(By.XPATH,'//*[@id="navTab"]/div[1]/div[4]')

    #主页
    loc_zhuye=(By.XPATH,'//*[@id="navTab"]/ul/li[1]/a')
    #返回结算
    loc_fan=(By.XPATH,'//*[@id="navTab"]/ul/li[2]/a')

    def jiesuan(self):
        """
         #点击结算管理
        :return:
        """
        try:
            self.click(self.loc_jiesuan)
        except Exception as e:
            print(e)

    def jilu(self):
        """
        #点击结算记录管理
        :return:
        """
        try:
            self.click(self.loc_jilu)
        except Exception as e:
            print(e)

    def faqijiesuan(self):
        """
        发起结算
        :return:
        """
        try:
            self.click(self.loc_faqi)
        except Exception as e:
            print(e)

    def fanhuijiesuan(self):
        """
        返回结算
        :return:
        """
        try:
            self.click(self.loc_fan)


        except Exception as e:
            print(e)
    def yhm(self):
        """
        用户名
        :return:
        """
        try:
            self.send_keys(self.loc_hym,'sdfgghg')
        except Exception as e:
            print(e)

    def daosanjiao(self):
        """
        倒三角
        :return:
        """
        try:
            self.click(self.loc_dao)
        except Exception as e:
            print(e)



    def bh(self):
        """
        编号
        :return:
        """
        try:
            self.send_keys(self.loc_bianhao,'5615313')
        except Exception as e:
            print(e)

    def yee(self):
        """
        余额
        :return:
        """
        try:
            self.send_keys(self.loc_ye,'1515')
        except Exception as e:
            print(e)

    def jinee(self):
        """
        金额
        :return:
        """
        try:
            self.send_keys(self.loc_je,'500')
        except Exception as e:
            print(e)

    def tijiao(self):
        """
        提交
        :return:
        """
        try:
            self.click(self.loc_bc)
        except Exception as e:
            print(e)

    def zhu(self):
        """
        提交
        :return:
        """
        try:
            self.click(self.loc_zhuye)
        except Exception as e:
            print(e)


    def dakuan(self):
        """
        打款
        :return:
        """
        try:
            self.click(self.loc_dakuan)
        except Exception as e:
            print(e)

    def shen(self):
        """
         #审核
        :return:
        """
        try:
            self.click(self.loc_shen)
        except Exception as e:
            print(e)

    def bei(self):
        """
        #输入备注
        :return:
        """
        try:
            self.send_keys(self.loc_bei,'哈哈')
        except Exception as e:
            print(e)

    def ti(self):
        """
        #点击取消
        :return:
        """
        try:

            self.click(self.loc_ti)
        except Exception as e:
            print(e)
    def chakan(self):
        '''
        查看
        :return:
        '''
        try:
            self.click(self.loc_chaka)
        except Exception as e:
            print(e)

    def shen(self):
        """
         # 打款
        :return:
        """
        try:

            self.click(self.loc_shen)
        except Exception as e:
            print(e)

    def shibai(self):
        """
         # 失败
        :return:
        """
        try:

            self.click(self.loc_shibai)
        except Exception as e:
            print(e)



    def bei(self):
        """
          # 输入备注
        :return:
        """
        try:

            self.send_keys(self.loc_bei, '已打款')
        except Exception as e:
            print(e)


    def ti(self):
        """
          # 点击提交
        :return:
        """
        try:

            self.click(self.loc_ti)
        except Exception as e:
            print(e)


    def fou(self):
        """
        #否
        :return:
        """
        try:

            self.click(self.loc_fou)
        except Exception as e:
            print(e)



    def ye(self):
        """
        # 输入页码

        :return:
        """
        try:

            self.send_keys(self.loc_ye, '100')
        except Exception as e:
            print(e)


    def sanjiao(self):
        """
           # 小三角
        :return:
        """
        try:
            self.click(self.loc_sanjiao)
        except Exception as e:
            print(e)





    def shen(self):
        """
        # 打款
        :return:
        """
        try:

            self.click(self.loc_shen)
        except Exception as e:
            print(e)




    def bei(self):
        """
           # 输入备注
        :return:
        """
        try:
            self.send_keys(self.loc_bei, '已打款')
        except Exception as e:
            print(e)

